package java_test.data_structure;

import java.util.Collections;
import java.util.Vector;

public class CollectionsIndex {
    public static void main(String[] args) {
        Vector v = new Vector();
        v.add("Z");
        v.add("M");
        v.add("D");
        v.add("A");
        v.add("O");
        Collections.sort(v);
        System.out.println(v);
        int index = Collections.binarySearch(v, "D");
        System.out.println(index);
        Object obj = Collections.max(v);
        System.out.println("最大元素是：" + obj);
        Collections.swap(v, 0, 4);
        System.out.println("旋转后");
        System.out.println(v);
    }
}
